package com.todo.strategy.online.infrastructure.mapper;

import com.todo.strategy.online.infrastructure.entity.po.MemoUserRelationPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author azhebuxing
 * @date 2024/11/28 23:36
 * @description
 */
@Mapper
public interface MemoUserRelationMapper {

    /**
     * 新增备忘录用户关联
     *
     * @param memoUserRelationPO
     * @return
     */
    int insertMemoUserRelation(MemoUserRelationPO memoUserRelationPO);

    /**
     * 根据主键更新备忘录用户关联
     *
     * @param memoUserRelationPO
     * @return
     */
    int updateMemoUserRelationById(MemoUserRelationPO memoUserRelationPO);

    /**
     * 根据主键删除备忘录用户关联
     *
     * @param id
     * @return
     */
    int removeMemoUserRelationById(Long id);

    /**
     * 根据主键查询备忘录用户关联
     *
     * @param id
     * @return
     */
    MemoUserRelationPO queryMemoUserRelationById(Long id);

    /**
     * 根据用户id和计划id查询备忘录用户关联
     *
     * @param userId
     * @param planId
     * @return
     */
    MemoUserRelationPO queryMemoUserRelationByUserIdAndPlanId(@Param("userId") Long userId, @Param("planId") Long planId);

    int removeMemoUserRelationByUserIdAndPlanId(@Param("userId") Long userId, @Param("planId") Long planId);
}
